// 路由规则 和 实例化路由对象
import Vue from 'vue';
import VueRouter from 'vue-router';

import Home from '../components/home/Home.vue' //首页
import Movie from '../components/Mouie/index.vue'//影院
import Show from '../components/Mouie/shou.vue'//影院下正在热映
import Adv from '../components/Mouie/adv.vue'//影院下即将上映

import Details from '../components/details/details.vue'//详情页

import User from '../components/user.vue'//登录页面
Vue.use(VueRouter);

export default new VueRouter({
    routes: [
        {
            // 首页
            path: '/home',
            component: Home
        },
        {
            //影院
            path:'/movie',
            component:Movie,
            children:[
                {
                    path:'show',
                    component:Show
                },
                {
                    path:'adv',
                    component:Adv
                },
                {
                    path:'*',
                    redirect: 'show'
                }
            ]
        },
        {
            path:'/details/:id',
            name:'details',
            component:Details
        },
        {
            path:'/user',
            component:User
        },
        {
            path: '*',
            redirect: '/home'
        },
    ]
})